Skip to content

fix: error handling — no more silent failures#28

Merged
robbycochran merged 3 commits into
mainfrom
rc-refactor
Jun 5, 2026
Merged

fix: error handling — no more silent failures#28
robbycochran merged 3 commits into
mainfrom
rc-refactor

Conversation

@robbycochran

@robbycochran robbycochran commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes all 16 findings from issue #22 (silent error swallowing). No more exit-0-on-failure, infinite loops, or cascading errors from unchecked operations.

Critical fixes

  • newRemote returns error on job failure — was printing "Launcher failed." then returning nil (exit 0)
  • Job polling has 10-minute timeout — was an infinite loop with no escape
  • Retry messages include the actual error — was "failed (supervisor race)" with no context
  • deploy create ns is idempotent — ignore AlreadyExists on re-run
  • reuse-gateway selects OCP gateway — error scenarios could leave local gateway selected

Error propagation added

  • Helm install, CRD install, RBAC apply, gateway rollout, GatewayAdd
  • ConfigMap apply before launching job
  • os.WriteFile for GWS creds + client_secret.json
  • os.RemoveAll for staging dir
  • Actionable error messages with debug commands

Best-effort operations (intentionally unchecked, commented)

  • Cleanup deletes (old jobs/pods)
  • SCC grants (oc may not exist)
  • SandboxDelete during retry cleanup

Test results (full matrix validated including Go + OCP)

Path Result
Go unit tests 47/47
Launcher tests 7/7
Bats (both) 29/29
bash + podman 19/19
Go + podman 19/19
Go + OCP (reuse-gateway) 17/17

Closes #22.

robbycochran and others added 3 commits June 4, 2026 23:36
Critical fixes:
- newRemote returns error when launcher job fails (was returning nil)
- Job status polling has 10-minute timeout (was infinite loop)
- Retry messages include the actual error for diagnosis
- deploy create ns is idempotent (ignore AlreadyExists)

Error propagation:
- Helm install failure → clear error instead of cascading Route error
- CRD install failure → stops deploy instead of continuing
- RBAC apply failure → stops deploy
- Gateway rollout timeout → clear error
- GatewayAdd failure → stops deploy
- ConfigMap apply in newRemote → checked before launching job
- os.WriteFile for GWS credentials → checked in creds.go
- os.WriteFile for client_secret.json → checked in profile.go
- os.RemoveAll for staging dir → checked in newLocal

Best-effort operations (intentionally unchecked, commented):
- Cleanup deletes (old jobs/pods before re-create)
- SCC grants (oc may not exist on non-OpenShift)
- Gateway remove in teardown loop
- SandboxDelete during retry cleanup

Closes #22.

Validated: unit 47+7, bats 29+29, podman 19+19, OCP 17/17.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The error scenarios could leave the local podman gateway selected,
causing sandbox_verify to query the wrong gateway. Now explicitly
selects the OCP gateway (by name pattern *-remote-*) at the start
of the reuse-gateway OCP flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robbycochran robbycochran merged commit 502052a into main Jun 5, 2026
@robbycochran robbycochran deleted the rc-refactor branch June 13, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: silent error swallowing across deploy/new/teardown flows

1 participant